package edu.pku.sei.act.main.palette;

import java.util.ArrayList;
import java.util.List;

import edu.pku.sei.act.images.ArchiModelImageProvider;
import edu.pku.sei.act.model.common.ArchiModelConst;
import edu.pku.sei.gmp.editor.palette.GMPEntryDescriptor;
import edu.pku.sei.gmp.editor.palette.GMPEntryType;
import edu.pku.sei.gmp.editor.palette.GMPPaletteFactory;
import edu.pku.sei.gmp.model.common.GMPModel;

public class ArchiModelerPackagePaletteFactory extends GMPPaletteFactory{

	public ArchiModelerPackagePaletteFactory(GMPModel model) {
		super(model);
	}
	
	@Override
	protected List<GMPEntryDescriptor> getEntryList(String diagramType) {
		if(diagramType.equals(ArchiModelConst.__ARCHIMODELPACKAGEDIAGRAM__)){
			List<GMPEntryDescriptor> desc = new ArrayList<GMPEntryDescriptor>();
			
			GMPEntryDescriptor entry = new GMPEntryDescriptor();
			entry.elementType = ArchiModelConst.__PACKAGE__;
			entry.label = "Package";
			entry.shortDesc = "Create a Package ";
			entry.iconSmall = ArchiModelImageProvider
					.getImageDescriptor(ArchiModelImageProvider.PACKAGE);
			entry.entryType = GMPEntryType.NODE;
			desc.add(entry);
			
			entry = new GMPEntryDescriptor();
			entry.elementType = ArchiModelConst.__MOTEFORPACKAGE__;
			entry.label = "Mote";
			entry.shortDesc = "Create a Mote ";
			entry.iconSmall = ArchiModelImageProvider
					.getImageDescriptor(ArchiModelImageProvider.MOTE);
			entry.entryType = GMPEntryType.NODE;
			desc.add(entry);
			
			return desc;
			
		}else{
			return null;	
		}
	}

}
